

****GET CPS DATA IN $1990 

clear
use "bls_prices_2.dta"
* normalize cpi to equal one in base years

foreach num in 1990  {
	gen norm`num' = cpi if year==`num'
	sort year
	replace norm`num' = norm`num'[_n-1] if norm`num'==.
	gsort -year
	replace norm`num' = norm`num'[_n-1] if norm`num'==.
	gen cpi_`num' = cpi/norm`num'
	
}
* save
keep year cpi_*
sort year
save cpi_allyears_2, replace 


clear
use cps_00003
sort year serial pernum
merge m:1 year using cpi_allyears_2
drop _merge

gen hhincome_1990 = hhincome/cpi_1990

keep if relate==101
	
* Census division
gen division = 1 if region==11
replace division = 2 if region==12
replace division = 3 if region==21
replace division = 4 if region==22
replace division = 5 if region==31
replace division = 6 if region==32
replace division = 7 if region==33
replace division = 8 if region==41
replace division = 9 if region==42

save income_b1990.dta,replace
